package com.zhanglijie.base.start;

import java.util.Map;
/**
 * @author zhanglijie
 * @version 1.0
 * @since 1.1.0 2022/3/13 0013 1:02
 * 默认main函数运行时候  jvm会给我们创建多少个线程呢？
 * Thread[main,5,main]
 * Thread[Monitor Ctrl-Break,5,main]
 * Thread[Attach Listener,5,system]
 * Thread[Reference Handler,10,system]
 * Thread[Signal Dispatcher,9,system]
 * Thread[Common-Cleaner,8,InnocuousThreadGroup]
 * Thread[Finalizer,8,system]
 *
 */

public class Main {
    public static void main(String[] args) {
        Map<Thread, StackTraceElement[]> allStackTraces = Thread.getAllStackTraces();
        for (Map.Entry<Thread, StackTraceElement[]> threadEntry : allStackTraces.entrySet()) {
            System.out.println(threadEntry.getKey());
        }
    }
}
